import React, { PureComponent, Suspense, lazy } from 'react'
import { Route, Switch, Redirect } from 'react-router-dom'
import { Spin } from 'antd'

const SpinFn = () => {
  return (
    <div className={'ant-loading'}>
      <Spin></Spin>
    </div>
  )
}

class App extends PureComponent {
  constructor(props) {
    super(props)
    this.state = {}
  }

  render() {
    return (
      <Suspense fallback={<></>}>
        <Switch>
          <Route path={'/index'} component={lazy(() => import('@/views/index.js'))}></Route>
          <Redirect from={'/'} to={'/index'}></Redirect>
        </Switch>
      </Suspense>
    )
  }
}

App.propTypes = {}

export default App
